package com.mlnx.web.data.controller;

import com.mlnx.common.entity.ResponseData;
import com.mlnx.data.service.EcgDataService;
import com.mlnx.stream.service.DeviceBroadcastService;
import com.mlnx.web.base.controller.BaseController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * Created by amanda.shan on 2020/1/2.
 */
@Api(value = "数据系统接口", tags = {"数据系统接口"})
@RestController
@RequestMapping("mlnx_data/system")
public class DataSystemController extends BaseController {

    @Autowired
    private EcgDataService ecgDataService;

    @Autowired
    private DeviceBroadcastService deviceBroadcastService;

    @ApiOperation("获取心电保存耗时，?/秒*线程数")
    @GetMapping(value = "/aveTimeBySecond")
    public ResponseData<Long> getSaveTimeBySecond() {
        return result(ecgDataService.getSaveTimeBySecond());
    }

    @ApiOperation("未处理的心电数据数量")
    @GetMapping(value = "/notProcessEcgCount")
    public ResponseData<Long> getEcgNotProcessCount() {
        return result(deviceBroadcastService.getEcgNotProcessCount());
    }
}
